<!DOCTYPE html>
<HTML>
<HEAD>
    <TITLE> ZTREE DEMO </TITLE>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" href="./css/demo.css" type="text/css">
    <link rel="stylesheet" href="./css/metroStyle/metroStyle.css" type="text/css">
    <script type="text/javascript" src="./js/jquery-1.4.4.min.js"></script>
    <script type="text/javascript" src="./js/jquery.ztree.core.js"></script>
    <script type="text/javascript" src="./js/jquery.ztree.excheck.js"></script>
    <script type="text/javascript" src="./js/jquery.ztree.exedit.js"></script>
    <style>
        .ztree * {
            font-size: 16px;
        }

        .ztree li {
            line-height: 30px;
        }

        .ztree li span {
            line-height: 25px;
            margin-right: 2px;
        }
    </style>
    <SCRIPT LANGUAGE="JavaScript">
        var zTreeObj;
        // zTree 的参数配置，深入使用请参考 API 文档（setting 配置详解）
        var setting = {
            check: {enable: true},//可勾线
            chkboxType: {"Y": "ps", "N": "ps"},//选中取消时父子关系
            view: {selectedMulti: false, showIcon: false}
        };
        // zTree 的数据属性，深入使用请参考 API 文档（zTreeNode 节点数据详解）
        var zNodes = [
            {
                name: "SunTech",
                open: true,
                children: [
                    {
                        name: "品牌管理",
                        open: true,
                        children: [
                            {name: "品牌管理—编辑折扣", checked: true},
                            {name: '品牌管理—品牌上下架'}]
                    },
                ]
            }, {
                name: "员工", checked: true
            }, {
                name: "订单"
            }

        ];
        $(document).ready(function () {
            zTreeObj = $.fn.zTree.init($("#treeDemo"), setting, zNodes);
            var zTree = $.fn.zTree.getZTreeObj("treeDemo");
            $("#submit-btn").click(function () {

            })

            console.log(     zTree.getCheckedNodes(true));
        });
    </SCRIPT>
</HEAD>
<BODY>
<div>
    <ul id="treeDemo" class="ztree"></ul>
</div>
</BODY>
</HTML>